import request from '@/utils/request'

// 查询附件管理列表
export function listAttachment(query) {
  return request({
    url: '/system/attachment/list',
    method: 'get',
    params: query
  })
}

// 查询附件管理详细
export function getAttachment(id) {
  return request({
    url: '/system/attachment/' + id,
    method: 'get'
  })
}

// 保存附件信息
export function saveAttachment(data) {
  return request({
    url: '/system/attachment/uploadAttachment',
    method: 'post',
    params: data
  })
}

// 删除附件管理
export function delAttachment(id) {
  return request({
    url: '/system/attachment/' + id,
    method: 'delete'
  })
}

// 删除附件管理 根据文件路径
export function delAttachmentByFilePath(filePath) {
  return request({
    url: '/system/attachment/delAttachmentByFilePath',
    method: 'delete',
    params: {
      filePath
    }
  })
}

// 根据文件路径获取详情
export function getAttachmentByFilePath(filePath) {
  return request({
    url: '/system/attachment/getAttachmentByFilePath',
    method: 'get',
    params: {
      filePath
    }
  })
}

// 导出附件管理
export function exportAttachment(query) {
  return request({
    url: '/system/attachment/export',
    method: 'get',
    params: query
  })
}
